<?php namespace Common\Model;
use Hdphp\Model\Model;
//模型
class User extends Model
{
	//登陆表名称
	protected $table="user";
	//自动验证	必须通过create方法来触发
	protected $validata=array(
	//1.name名称2.验证规则3.提示信息4.验证条件5.验证时间
		array("username","required","请输入名称",3,3),
		array("password","required","请输入密码",3,3),
	);
	
	//登陆方法
	public function login()
	{
		p($_POST);
		//自动验证
		if(!$this->create()) return false;
		$username =$_POST['username'];
		$password = $_POST['password'];

		
	}
}

















